package com.example.myapplication.delegate

import com.example.myapplication.utils.EncryptionUtil
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

class EncryptionDelegate: ReadWriteProperty<Any?, String> {
    var curValue = ""

    override fun getValue(thisRef: Any?, property: KProperty<*>): String {
        return curValue
    }

    override fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
        curValue = EncryptionUtil.aesEncode(value)
    }

}